YES 0.834
H-Termination proof of /home/matraf/haskell/eval_FullyBlown_Fast/List.hs
H-Termination of the given Haskell-Program with start terms could successfully be proven:
↳ HASKELL
↳ CR
mainModule List
| ((maximumBy :: (a -> a -> Ordering) -> [a] -> a) :: (a -> a -> Ordering) -> [a] -> a) |
module List where
| import qualified Maybe import qualified Prelude
|
| maximumBy :: (a -> a -> Ordering) -> [a] -> a
maximumBy | _ [] | = | error [] |
maximumBy | cmp xs | = |
foldl1 max xs | where |
max | x y | = |
case | cmp x y of |
| GT | -> | x |
| _ | -> | y |
|
|
|
|
|
module Maybe where
| import qualified List import qualified Prelude
|
Case Reductions:
The following Case expression
case | cmp x y of |
| GT | → x |
| _ | → y |
is transformed to
max0 | x y GT | = x |
max0 | x y _ | = y |
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
mainModule List
| ((maximumBy :: (a -> a -> Ordering) -> [a] -> a) :: (a -> a -> Ordering) -> [a] -> a) |
module List where
| import qualified Maybe import qualified Prelude
|
| maximumBy :: (a -> a -> Ordering) -> [a] -> a
maximumBy | _ [] | = | error [] |
maximumBy | cmp xs | = |
foldl1 max xs | where |
max | x y | = | max0 x y (cmp x y) |
|
max0 | x y GT | = | x |
max0 | x y _ | = | y |
|
|
|
|
module Maybe where
| import qualified List import qualified Prelude
|
Replaced joker patterns by fresh variables and removed binding patterns.
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
mainModule List
| ((maximumBy :: (a -> a -> Ordering) -> [a] -> a) :: (a -> a -> Ordering) -> [a] -> a) |
module List where
| import qualified Maybe import qualified Prelude
|
| maximumBy :: (a -> a -> Ordering) -> [a] -> a
maximumBy | vw [] | = | error [] |
maximumBy | cmp xs | = |
foldl1 max xs | where |
max | x y | = | max0 x y (cmp x y) |
|
max0 | x y GT | = | x |
max0 | x y vx | = | y |
|
|
|
|
module Maybe where
| import qualified List import qualified Prelude
|
Cond Reductions:
The following Function with conditions
is transformed to
undefined0 | True | = undefined |
undefined1 | | = undefined0 False |
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ LetRed
mainModule List
| ((maximumBy :: (a -> a -> Ordering) -> [a] -> a) :: (a -> a -> Ordering) -> [a] -> a) |
module List where
| import qualified Maybe import qualified Prelude
|
| maximumBy :: (a -> a -> Ordering) -> [a] -> a
maximumBy | vw [] | = | error [] |
maximumBy | cmp xs | = |
foldl1 max xs | where |
max | x y | = | max0 x y (cmp x y) |
|
max0 | x y GT | = | x |
max0 | x y vx | = | y |
|
|
|
|
module Maybe where
| import qualified List import qualified Prelude
|
Let/Where Reductions:
The bindings of the following Let/Where expression
foldl1 max xs |
where |
max | x y | = max0 x y (cmp x y) |
|
|
max0 | x y GT | = x |
max0 | x y vx | = y |
|
are unpacked to the following functions on top level
maximumByMax0 | wu x y GT | = x |
maximumByMax0 | wu x y vx | = y |
maximumByMax | wu x y | = maximumByMax0 wu x y (wu x y) |
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ LetRed
↳ HASKELL
↳ Narrow
mainModule List
| (maximumBy :: (a -> a -> Ordering) -> [a] -> a) |
module List where
| import qualified Maybe import qualified Prelude
|
| maximumBy :: (a -> a -> Ordering) -> [a] -> a
maximumBy | vw [] | = | error [] |
maximumBy | cmp xs | = | foldl1 (maximumByMax cmp) xs |
|
|
maximumByMax | wu x y | = | maximumByMax0 wu x y (wu x y) |
|
|
maximumByMax0 | wu x y GT | = | x |
maximumByMax0 | wu x y vx | = | y |
|
module Maybe where
| import qualified List import qualified Prelude
|
Haskell To QDPs
↳ HASKELL
↳ CR
↳ HASKELL
↳ BR
↳ HASKELL
↳ COR
↳ HASKELL
↳ LetRed
↳ HASKELL
↳ Narrow
↳ QDP
↳ QDPSizeChangeProof
Q DP problem:
The TRS P consists of the following rules:
new_foldl(wv3, :(wv410, wv411), ba) → new_foldl(wv3, wv411, ba)
R is empty.
Q is empty.
We have to consider all minimal (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem. From the DPs we obtained the following set of size-change graphs:
- new_foldl(wv3, :(wv410, wv411), ba) → new_foldl(wv3, wv411, ba)
The graph contains the following edges 1 >= 1, 2 > 2, 3 >= 3